package org.esprit.ocm.client.rpc.ec2;

import java.util.List;

import org.esprit.ocm.dto.ec2.impl.KeyPairInfoMappingDto;
import org.esprit.ocm.dto.impl.AwsCredentialsDto;
import org.esprit.ocm.dto.impl.ServerDto;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("KeyPairService.rpc")
public interface KeyPairService extends RemoteService {

	/**
	 * Create a keypair.
	 * 
	 * @param name
	 *            Name of the keypair.
	 * @return KeyPairInfo or null in case of error.
	 */
	public KeyPairInfoMappingDto createKeypair(String name, ServerDto server, AwsCredentialsDto credentials);

	/**
	 * Delete a keypair.
	 * 
	 * @param name
	 *            Name of the keypair.
	 * 
	 * @return true if successfull, false else
	 */
	public boolean deleteKeypair(String name, ServerDto server, AwsCredentialsDto credentials);

	/**
	 * List available keypairs.
	 * 
	 * @return List of keypairs (may be empty) or null in case of error.
	 */
	public List<KeyPairInfoMappingDto> listKeypairs(ServerDto server, AwsCredentialsDto credentials);

	/**
	 * Gets the properties of a specific keypair.
	 * 
	 * @param name
	 *            The name of the keypair.
	 * @return KeypairInfo or null in case of error or if keypair does not
	 *         exist.
	 */
	public KeyPairInfoMappingDto describeKeypair(String name, ServerDto server, AwsCredentialsDto credentials);
}
